/*

 *
 * Project  : VPC
 * Name   : InitServlet.java
 *
 */
package com.virtium.vpc.action;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.virtium.vpc.utils.ApplicationConstant;
import com.virtium.vpc.utils.FileUtil;



public class InitServlet extends HttpServlet {
	private static Log log = LogFactory.getLog(InitServlet.class);

	public void init() {
		log.info("InitServlet Startup.");
		try {
			
			//set path for cmc2 folder in webapps folder
			FileUtil.virtiumServerPath = getServletContext().getRealPath("/");
			
			String constantFile = getInitParameter("constantfile");
			log.debug("FileUtil.cmc2Path = " + FileUtil.virtiumServerPath  + ", constantFile=" + constantFile);
					
			
			ApplicationConstant.setFileName(FileUtil.virtiumServerPath + constantFile);

		} catch (Exception e) {
			log.error("Exception", e);
		}
	}

	public void doGet(HttpServletRequest req, HttpServletResponse res) {
	}

	public void doPost(HttpServletRequest req, HttpServletResponse res) {
	}

}
